import request from '../utils/request';
/**
 * 获取验证码
 */
export function getCode(mobile) {
  return request({
    method: 'get',
    url: '/v1_0/sms/codes/' + mobile,
  });
}

/**
 * 登录请求，用于用户登录
 */
export const login = ({ mobile, code }) => {
  return request({
    method: 'POST',
    url: '/v1_0/authorizations',
    data: {
      mobile,
      code,
    },
  });
};
/**
 * 获取用户个人资料
 */
export const getUserInfo = () => {
  return request({
    url: '/v1_0/user/profile',
  });
};
